#ifndef _DATABASE_H_
#define _DATABASE_H_
#include "Result.h"
#include <WinSock2.h>
#include <mysql.h>

#define WorldPacket std::string
#define sDataBase Database::GetInstance()

enum DataBaseType
{
	WorldDatabase, LoginDataBase, CharacterDatabase,
};

class Database
{
public:
	Database();
	~Database();
	//defines
	typedef int PlayerGuid;

	//static
	static Database* GetInstance();
	void PExcude(DataBaseType type, const char* args, ...);
	bool ConnectDatabaes();
	void StartDataBaseHoding(int diff);
	void GetUpdate();
	Result::Qurey GetResult(DataBaseType type, const char* args);
	WorldPacket HandleAuthResutLogin(WorldPacket& _WorldPacket);
private: 
	unsigned int Databasestarttime;
	int DataBaseHodingTimer;
	std::string server;
	std::string user;
	std::string password;
	std::string database;
	int port;
};




#endif